﻿<!DOCTYPE html>
<!--受限空间填报-->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <script src="../../static/js/Resource/JobLicenseApp_wanglr.js"></script>
    <script src="../../static/js/Mock/JobLicenseApp_wanglr.js"></script>
    <link href="../../static/js/vue-treeselect/vue-treeselect.css" rel="stylesheet" />
    <script src="../../static/js/vue-treeselect/vue-treeselect.js"></script>
    <style>
    </style>
    <style>
        body {
            padding-bottom: 10px;
        }
        .el-dialog__body {
            height: 100% !important;
        }

        .el-dialog.is-fullscreen {
            overflow: hidden !important;
        }

  
        .toptitle label {
            margin-left: 20px;
        }

        .thead {
            color: #909399;
            font-weight: 700;
        }

        table {
            width: 100%;
            border-top: 1px solid #EBEEF5;
            border-left: 1px solid #EBEEF5;
            text-align: center;
            color: #606266;
            /*border-right: none;*/
        }

            table td {
                border-right: 1px solid #EBEEF5;
                border-bottom: 1px solid #EBEEF5;
                /*height:38px;*/
                padding: 10px;
            }
    </style>
</head>
<body>
    
<div id="app" v-cloak>   
        <div style="width:100%;text-align:center ">
            <label style="font-weight:bold;color: #909399;">受限空间清单</label>
        </div>
        <div style="width:100%;text-align:right;color: #909399;" class="toptitle">
            <label><el-link type="primary" style="color:#409eff;cursor:pointer;" @click="DialogInput">选择清单</el-link></label>
            <label>Q/G11-018-R01</label>
            <label>No.：{{Form.id}}</label>
        </div>
        <el-form :model="Form" status-icon style="margin-top:5px;width:100%" :rules="rules" ref="ruleForm">
            <table cellpadding="0" cellspacing="0" style="">
                <tr class="thead">
                    <td width="15%">{{WireRopeAndHookCheck.CheckNo}}</td>
                    <td width="10%">{{GeneralLiftingWorkSafety.Department}}</td>

                    <td width="10%">{{ConfinedSpace.Name}}</td>
                    <td width="15%">{{ConfinedSpace.Location}}</td>
                    <td width="15%">{{ConfinedSpace.StorageMedia }}</td>
                    <td width="15%">{{ConfinedSpace.RiskFactors}}</td>
                    <td width="20%">{{ScaffoldingChecklist.Remarks}}</td>
                </tr>
                <tr v-for="(v,i) in Form.List">
                    <td :title="v.id">{{v.id}}</td>
                    <td :title="getDicValue(v.Department)">{{getDicValue(v.Department)}}</td>

                    <td :title="v.Name">{{v.Name}}</td>
                    <td :title="v.Location">{{v.Location}}</td>
                    <td :title="v.StorageMedia">{{v.StorageMedia}}</td>
                    <td :title="v.RiskFactors">{{v.RiskFactors}}</td>
                    <td :title="v.Remark">{{v.Remark}}</td>
                </tr>
                <tr>
                    <td>{{ConfinedSpace.Editor}}</td>
                    <td colspan="6">
                        <treeselect v-model="Form.Editor" :options="Editor" :flat="true"
                                    :show-count="true" :disable-branch-nodes="true" placeholder="请选择"
                                    style="line-height: 28px" />
                    </td>
                </tr>
                <tr>
                    <td>{{ConfinedSpace.Auditor}}</td>
                    <td colspan="6">
                        <treeselect v-model="Form.Auditor" :options="Auditor" :flat="true"
                                    :show-count="true" :disable-branch-nodes="true" placeholder="请选择"
                                    style="line-height: 28px" />
                    </td>
                </tr>
                <tr>
                    <td>{{SafeOperationPlan.ApprovedBy}}</td>
                    <td colspan="6">
                        <treeselect v-model="Form.ApprovedBy" :options="ApprovedBy" :flat="true"
                                    :show-count="true" :disable-branch-nodes="true" placeholder="请选择"
                                    style="line-height: 28px" />  
                    </td>
                </tr>
            </table>

            <el-row>
                <el-form-item style="text-align:center; padding-top:5px">
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>
                    <el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
        <el-dialog :title="DialogTitle" :visible.sync="ListItem.dialogVisible" width="80%" height="80%" top="10vh"  @close='closeDialog' fullscreen="true">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        Vue.component('treeselect', VueTreeselect.Treeselect)
        app = new Vue({
            el: '#app',
            data: {
                id: '',
                DialogTitle: '受限空间信息选择',
                mydata: PersonInChargeTree,
                ListItem: ListItem,
                Form: {
                    id: Mock.Random.id(),//编号
                    Editor: null,//编制人
                    Auditor: null,//审核人
                    ApprovedBy: null,//批准人
                    Date: '',//填报时间
                    List: [],
                },
                Editor: [],
                Auditor: [],
                ApprovedBy: [],
                rules: {},
                //childrenAdd:[],//子页传参
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                closeDialog: function () {
                    console.log('this.Form.List', this.Form.List)

                   // this.getData();
                },
                getDicValue: function (value) {
                    return getTreeValue(this.mydata, value);
                },
                getData: function () {
                    if (this.id!='null') {
                        getData(this, '/api/ConfinedSpace/get?id=' + this.id);
                    }
                },
                DialogInput: function () {
                    DialogShow(this, 'xg', "ConfinedSpaceInputInput.html", this.id);
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            onSubmitForm(this, '/api/ConfinedSpace/Save', mythis.Form);
                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
            },
            mounted: function () {
                this.Editor = fn(this.mydata, "0");
                this.Auditor = fn(this.mydata, "0");
                this.ApprovedBy = fn(this.mydata, "0");
                this.id = getUrlParam("id");
                this.getData();
            }
        });
    </script>
</body>

</html>